<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Insert title here</title>
        {load: __PUBLIC__/JQuery/jquery-1.4.4.js}
        {load: __PUBLIC__/JQuery/ui/jquery.ui.core.js}
        {load: __PUBLIC__/JQuery/ui/jquery.ui.widget.js}
        {load: __PUBLIC__/css/grid.css}
        {load: __PUBLIC__/JQuery/themes/base/jquery.ui.all.css}
        {load: __PUBLIC__/JQuery/ui/jquery.ui.button.js}
        {load: __PUBLIC__/JQuery/ui/jquery.ui.dialog.js}
        {load: __PUBLIC__/JQuery/ui/jquery.ui.draggable.js}
        {load: __PUBLIC__/JQuery/ui/jquery.ui.position.js}
        <script type="text/javascript">
            $(document).ready(function()
            {
                //JQuery codes here
                //JQuery is the auxiliary controller
                $("#modifyto").hide();
                $("#submit").click(function()
                {
                    tmp = '<tr><th width="80" scope="col">UID</th><th width="152" scope="col">用户名</th><th width="100" scope="col">真实姓名</th><th width="50" scope="col">&nbsp;</th></tr>';
                    $.post('/TDX/index.php?s=/User/ajaxuser', $("#userlist").serialize(), function(data){
                        $("table").html(tmp+data);
                        $("tr:odd").css('background-color', 'rgb(153,204,255)');
                        $("tr").find("th").css('padding', '4px');
                        $("td").css("padding", "3px 0px");
                        $("td").css("font-size", "12px");
                        $("td").css("font-family", "Microsoft YaHei");
                        $("tr").css('text-align', 'center');
                        $("tr:first").css('background-color', 'rgb(153,153,153)');
                        $("tr:first").css('font-family', 'SimHei');
                        $("tr:first").css('font-size', '20px');
                        $("a.modify").each(function(){
                            $(this).click(function(){
                                userid = $(this).parent().siblings().first().text();
                                $("#confirm").button();
                                $("#plist").load('/TDX/index.php?s=/Core/getAvailable', {UID: userid}, function(){});
                                $("#modifyto").show();
                                $("#confirm").click(function(){
                                    $("#tochange").attr('value', userid);
                                    $.post('/TDX/index.php?s=/User/setP', $("#newp").serialize(), function(data){
                                        $("#result").html(data);
                                        $("#dialog-message").dialog({
                                            modal: true,
                                            buttons: {
                                                Ok: function(){
                                                    $(this).dialog("close");
                                                }
                                            }
                                        })
                                    });
                                });
                            });
                        });
                    });
                });
		
            });
        </script>
        <!-- Insert the CSS Codes here -->
        <style type="text/css">
            .modify{
                text-decoration: none;
                color: rgb(27,32,132);
            }
            a:hover.modify{
                color: #999999;
            }
        </style>
    </head>
    <!--The followings are contents of the page-->
    <body>
        <p>请先通过查询选择需要更改的用户：</p>
        <form action="" id="userlist">
            <p>请选择查询依据
                <select name="query_type">
                    <option value="uid">UID</option>
                    <option value="name">用户名</option>
                </select></p>
            <p>请输入查询关键字
                <input type="text" name="keyword"/></p>
            <input id="submit" type="button" class="btnsubmit" value="提交" onmouseover="this.style.backgroundPosition='left -40px'" onmouseout="this.style.backgroundPosition='left top'" />
        </form>
        <div class="row">
            <div class="titlecolumn grid_6">
                <p class="smalltitle">查询结果</p>
                <table width="400" border="0">
                </table>
            </div>
        </div>
        <div id="modifyto" class="row">
            <div class="column grid_6">
                <p>更改用户权限为：</p>
                <form action="" id="newp" name="newp">
                    <select id="plist" name="plist">
                    </select>
                    <input type="button" value="确认更改" id="confirm">
                    <input type="hidden" name="UID" id="tochange" value="">
                </form>
            </div>
        </div>
        <div id="dialog-message" title="提示">
            <p id="result"></p>
        </div>
    </body>
</html>